<?php
/**
 * User:chendenan
 * Created On 2022/3/19 0019 18:44
 */
namespace app\common\business;
class BusBase {
    public function add($data){
        $data['status'] = config("status.mysql.table_normal");
//        $res = $this->model->getByName($data['name']);
//        if($res!=null){
//            throw new \think\Exception("已经存在");
//        }
        try{
            $this->model->save($data);
        }catch (\Exception $e){
            //记录日志
            trace($e->getMessage(),"error");
            return false;
        }
        //返回主键ID
        return $this->model->id;
    }
}